var layer;

layui.use("layer",function(){
    layer=layui.layer;
})


//ajax提交的函数
function requestAjax(url,type,dataType,param,$success){
    var load; //加载等待图标的组件
    $.ajax({
        url:url,
        type:type,
        data:param,
        dataType:dataType,
        before: function(){
            load=layer.load();
        } ,
        success:$success,
        complete:function(){
            layer.close(load);
        },
        error:function(jqxhr){
            layer.msg(jqxhr.status);
        }
    });
}

//HTML获取URL路径后边的参数
function getQueryString(name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
    var r = window.location.search.substr(1).match(reg);
    if (r != null) return unescape(r[2]);
    return null;
} 